package com.dongbo.recorder.screenrecord.ui.fragment;

import android.Manifest;
import android.content.Intent;
import android.media.MediaScannerConnection;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdLoadType;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemChildClickListener;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.coder.ffmpeg.call.CommonCallBack;
import com.coder.ffmpeg.jni.FFmpegCommand;
import com.coder.ffmpeg.utils.FFmpegUtils;
import com.dongbo.recorder.screenrecord.ui.activity.EditActivity;
import com.dongbo.recorder.screenrecord.ui.activity.LoginActivity;
import com.dongbo.recorder.screenrecord.ui.activity.VipActivity;
import com.dongbo.recorder.screenrecord.utils.eventbus.EventMessage;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.interfaces.OnConfirmListener;
import com.lxj.xpopup.interfaces.OnInputConfirmListener;
import com.lxj.xpopup.interfaces.OnSelectListener;
import com.tbruyelle.rxpermissions3.RxPermissions;
import com.umeng.analytics.MobclickAgent;
import com.dongbo.recorder.screenrecord.AppLpds;
import com.dongbo.recorder.screenrecord.R;
import com.dongbo.recorder.screenrecord.adapter.VideoAdapter;
import com.dongbo.recorder.screenrecord.base.BaseFragment;
import com.dongbo.recorder.screenrecord.bean.ScreenRecordBean;
import com.dongbo.recorder.screenrecord.contents.Contents;
import com.dongbo.recorder.screenrecord.dialog.ProgressPop;
import com.dongbo.recorder.screenrecord.dialog.ToVipDialog;
import com.dongbo.recorder.screenrecord.ui.activity.PlayActivity;
import com.dongbo.recorder.screenrecord.utils.FileUtils;
import com.dongbo.recorder.screenrecord.utils.PermissionUtil;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 文件列表
 */
public class VideoListFragment extends BaseFragment {
    @BindView(R.id.videolist_empty)
    LinearLayout videolistEmpty;
    @BindView(R.id.videolist_rv)
    RecyclerView videolistRv;
    @BindView(R.id.videolist_chooseall)
    TextView videolistChooseall;
    @BindView(R.id.videolist_delete)
    TextView videolistDelete;
    @BindView(R.id.videolist_choosell)
    LinearLayout videolistChoosell;
    @BindView(R.id.videolist_srl)
    SwipeRefreshLayout videolistSrl;

    private int selectPosi = -1;
    private VideoAdapter videoAdapter;
    List<ScreenRecordBean> videoList = new ArrayList<>();
    private boolean mIsExpress = false; //是否请求模板广告
    private boolean mIsLoaded = false; //视频是否加载完成
    private TTRewardVideoAd mttRewardVideoAd;
    private boolean mHasShowDownloadActive = false;

    //模式选择 0无 1编辑 2拼接
    private int modelType = 0;
    //是否全选
    private boolean isChooseAll = false;

    FileFragment fileFragment;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_videolist;
    }

    @Override
    protected void initView(View view, Bundle savedInstanceState) {
        fileFragment = (FileFragment) getParentFragment();
        initAdapter();
    }

    @Override
    protected void initData() {
        getVideoList();
    }

    @Override
    protected void initListener() {
        videolistSrl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                getVideoList();
            }
        });
    }

    private void initAdapter() {
        videolistRv.setLayoutManager(new LinearLayoutManager(getActivity()));
//        videolistRv.addItemDecoration(new RecycleViewDivider(getActivity(), LinearLayout.VERTICAL,
//                1, R.color.item_line));
        if (videoAdapter == null) {
            videoAdapter = new VideoAdapter();
            videoAdapter.addChildClickViewIds(R.id.video_clip, R.id.video_menu, R.id.video_export);
            videoAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
                @Override
                public void onItemChildClick(@NonNull BaseQuickAdapter adapter, @NonNull View view, int position) {
                    switch (view.getId()) {
                        case R.id.video_clip:
                            Intent intent = new Intent(getActivity(), EditActivity.class);
                            intent.putExtra("videoPath", videoAdapter.getItem(position).getPath());
                            startActivity(intent);
                            break;
                        case R.id.video_menu:
                            new XPopup.Builder(getContext())
                                    .atView(view)  // 依附于所点击的View，内部会自动判断在上方或者下方显示
                                    .asAttachList(new String[]{"剪辑",
                                                    "重命名",
//                                                    "分享",
                                                    "删除"},
                                            new int[]{R.mipmap.more_clip_icon,
                                                    R.mipmap.more_edit_icon,
//                                                    R.mipmap.more_share_icon,
                                                    R.mipmap.more_del_icon},
                                            new OnSelectListener() {
                                                @Override
                                                public void onSelect(int position2, String text) {
                                                    switch (position2) {
                                                        //剪辑
                                                        case 0:
                                                            Intent intent = new Intent(getActivity(), EditActivity.class);
                                                            intent.putExtra("videoPath", videoAdapter.getItem(position).getPath());
                                                            startActivity(intent);
                                                            break;
                                                        //重命名
                                                        case 1:
                                                            new XPopup.Builder(getActivity()).asInputConfirm(null, getResources().getString(R.string.tips_video_rename),
                                                                            ((ScreenRecordBean) adapter.getItem(position)).getFlieName().replace("0x", "").replace("1x", ""),
                                                                            new OnInputConfirmListener() {
                                                                                @Override
                                                                                public void onConfirm(String text) {
                                                                                    if (TextUtils.isEmpty(text)) {
                                                                                        Toast.makeText(requireContext(), "请输入新名称", Toast.LENGTH_SHORT).show();
                                                                                        return;
                                                                                    }
                                                                                    ScreenRecordBean screenRecordBean = (ScreenRecordBean) adapter.getItem(position);
                                                                                    String newPath = FileUtils.getRecordFileD(screenRecordBean.getPath()) + text + ".mp4";
                                                                                    FileUtils.renameFile(screenRecordBean.getPath(), newPath);
                                                                                    ((ScreenRecordBean) adapter.getItem(position)).setFlieName(text + ".mp4");
                                                                                    ((ScreenRecordBean) adapter.getItem(position)).setPath(newPath);
                                                                                    adapter.notifyItemChanged(position);
                                                                                }
                                                                            })
                                                                    .show();
                                                            break;
                                                        //分享
//                                                        case 2:
//                                                            showToast("分享");
//                                                            break;
                                                        //删除
                                                        case 2:
                                                            new XPopup.Builder(getActivity()).asConfirm(getResources().getString(R.string.tips),
                                                                            getResources().getString(R.string.tips_video_delete),
                                                                            new OnConfirmListener() {
                                                                                @Override
                                                                                public void onConfirm() {
                                                                                    if (FileUtils.deleteFile(((ScreenRecordBean) adapter.getItem(position)).getPath())) {
                                                                                        adapter.remove(position);
                                                                                        //如果列表空了就影藏
                                                                                        if (videoAdapter.getData().size() == 0) {
                                                                                            changeDeletet();
                                                                                        }
                                                                                    }
                                                                                }
                                                                            })
                                                                    .show();
                                                            break;
                                                    }
                                                }
                                            })
                                    .show();
                            break;
                        case R.id.video_export:
                            if (!AppLpds.getInstance().isShowAd()) {
                                if (TextUtils.isEmpty(AppLpds.getInstance().getUserId())) {
                                    startActivity(new Intent(getActivity(), LoginActivity.class));
                                } else if (AppLpds.getInstance().isVip()) {
                                    selectPosi = position;
                                    saveVideo();
                                } else {
                                    startActivity(new Intent(getActivity(), VipActivity.class));
                                }
                            } else {
                                if (!TextUtils.isEmpty(AppLpds.getInstance().getUserId())
                                        && AppLpds.getInstance().isVip()) {
                                    selectPosi = position;
                                    saveVideo();
                                    return;
                                }
                                selectPosi = position;
                                TTAdManager ttAdManager = TTAdSdk.getAdManager();
                                ttAdManager.requestPermissionIfNecessary(getActivity());
                                new RxPermissions(VideoListFragment.this)
                                        .requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                                        .subscribe(permission -> {
                                            if (permission.granted) {
                                                showVIPDialog();
                                            } else if (permission.shouldShowRequestPermissionRationale) {
                                                // Denied permission without ask never again
                                            } else {
                                                // Denied permission with ask never again
                                                // Need to go to the settings
                                                new XPopup.Builder(getActivity())
                                                        .asConfirm(getResources().getString(R.string.tips),
                                                                getResources().getString(R.string.tips_file_write),
                                                                new OnConfirmListener() {
                                                                    @Override
                                                                    public void onConfirm() {
                                                                        PermissionUtil.gotoPermission(getActivity());
                                                                    }
                                                                })
                                                        .setCancelText(getResources().getString(R.string.btn_sure))
                                                        .setConfirmText(getResources().getString(R.string.btn_gosetting))
                                                        .show();

                                            }
                                        });
                            }
                            break;
                    }
                }
            });
            videoAdapter.setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter,
                                        @NonNull View view,
                                        int position) {
                    if (modelType == 0) {
                        Intent intent = new Intent(getActivity(), PlayActivity.class);
                        intent.putExtra("videoPath", videoAdapter.getItem(position).getPath());
                        startActivity(intent);
                    } else {
                        videoAdapter.setChooseItem(position, !((ScreenRecordBean) adapter.getItem(position)).isChoose());
                    }
                }
            });
        }
        videolistRv.setAdapter(videoAdapter);
    }

    private void saveVideo() {
        new RxPermissions(VideoListFragment.this)
                .requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(permission -> {
                    if (permission.granted) {
                        String newPath = FileUtils.getRootFile() + videoAdapter.getItem(selectPosi).getFlieName().replace("0x", "").replace("1x", "");
                        if (FileUtils.getMoveFile(getContext(), videoAdapter.getItem(selectPosi).getPath(), newPath, true)) {
                            refreshAlbum(newPath);
                            getActivity().runOnUiThread(() -> {
//                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
//                                    showToast("文件已导出到相册");
////                                    showToast("文件已导出到相册" + "/Movies/"+newPath);
//                                } else {
                                showToast("文件已导出到" + newPath);
//                                }
                            });
                        } else {
                            getActivity().runOnUiThread(() -> {
                                showToast("文件导出失败");
                            });
                        }
                    } else if (permission.shouldShowRequestPermissionRationale) {
                        // Denied permission without ask never again
                    } else {
                        // Denied permission with ask never again
                        // Need to go to the settings
                        new XPopup.Builder(getActivity())
                                .asConfirm(getResources().getString(R.string.tips),
                                        getResources().getString(R.string.tips_file_write),
                                        new OnConfirmListener() {
                                            @Override
                                            public void onConfirm() {
                                                PermissionUtil.gotoPermission(getActivity());
                                            }
                                        })
                                .setCancelText(getResources().getString(R.string.btn_sure))
                                .setConfirmText(getResources().getString(R.string.btn_gosetting))
                                .show();

                    }
                });
    }

    private void refreshAlbum(String outputFile) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                // 扫描本地mp4文件并添加到本地视频库
                MediaScannerConnection mMediaScanner = new MediaScannerConnection(getContext(), null);
                mMediaScanner.connect();
                if (mMediaScanner != null && mMediaScanner.isConnected()) {
                    mMediaScanner.scanFile(outputFile, ".mp4");
                }
            }
        }).start();
    }

    @OnClick({R.id.videolist_chooseall,
            R.id.videolist_delete})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.videolist_chooseall:
                isChooseAll = !isChooseAll;
                videoAdapter.setChooseItem(-1, isChooseAll);
                break;
            case R.id.videolist_delete:
                new XPopup.Builder(getActivity()).asConfirm(getResources().getString(R.string.tips),
                                getResources().getString(R.string.tips_video_delete),
                                new OnConfirmListener() {
                                    @Override
                                    public void onConfirm() {
                                        Iterator iterator = videoAdapter.getData().iterator();
                                        while (iterator.hasNext()) {
                                            ScreenRecordBean screenRecordBean = (ScreenRecordBean) iterator.next();
                                            if (screenRecordBean.isChoose()) {
                                                if (FileUtils.deleteFile(screenRecordBean.getPath())) {
                                                    iterator.remove();
                                                    videoAdapter.notifyDataSetChanged();
                                                }
                                            }
                                        }
                                        changeDeletet();
                                    }
                                })
                        .show();
                break;
        }
    }

    /**
     * vip
     */
    private void showVIPDialog() {
        ToVipDialog mDialog = new ToVipDialog(getContext(),
                R.style.recharge_pay_dialog,
                new ToVipDialog.OnDialogEventListener() {
                    @Override
                    public void onVipClicked() {
                        if (TextUtils.isEmpty(AppLpds.getInstance().getUserId())) {
                            startActivity(new Intent(getActivity(), LoginActivity.class));
                            return;
                        }
                        startActivity(new Intent(getActivity(), VipActivity.class));
                    }

                    @Override
                    public void onGgClicked() {
                        loadAd();
                    }
                });
        mDialog.setCanceledOnTouchOutside(false);
        mDialog.show();
    }

    private boolean canSave;

    private void loadAd() {
        TTAdManager ttAdManager = TTAdSdk.getAdManager();
        TTAdNative ttAdNative = ttAdManager.createAdNative(getContext().getApplicationContext());
        AdSlot adSlot = new AdSlot.Builder()
                .setCodeId("945615259") // 广告代码位Id
                .setAdLoadType(TTAdLoadType.LOAD) // 本次广告用途：TTAdLoadType.LOAD实时；TTAdLoadType.PRELOAD预请求
                .build();
        ttAdNative.loadRewardVideoAd(adSlot, new TTAdNative.RewardVideoAdListener() {
            @Override
            public void onError(int i, String s) {
//                showToast("加载广告失败");
            }

            @Override
            public void onRewardVideoAdLoad(TTRewardVideoAd ttRewardVideoAd) {
//                ttRewardVideoAd.showRewardVideoAd(VipActivity.this);
//                onShowVideoAdListener(ttRewardVideoAd);
            }

            @Override
            public void onRewardVideoCached() {

            }

            @Override
            public void onRewardVideoCached(TTRewardVideoAd ttRewardVideoAd) {
                if (ttRewardVideoAd != null) {
                    //展示之前请先写监听
                    onShowVideoAdListener(ttRewardVideoAd);
                    // 此处的ad对象将用于广告展示
                    ttRewardVideoAd.showRewardVideoAd(getActivity());
                } else {
//                    showToast("加载广告失败");
                }
            }
        });
    }

    private void onShowVideoAdListener(TTRewardVideoAd ttRewardVideoAd) {
        ttRewardVideoAd.setRewardAdInteractionListener(new TTRewardVideoAd.RewardAdInteractionListener() {
            @Override
            public void onAdShow() {
                // 广告展示
            }

            @Override
            public void onAdVideoBarClick() {
                // 广告点击
            }

            @Override
            public void onAdClose() {
                // 广告关闭
            }

            @Override
            public void onVideoComplete() {
                // 广告素材播放完成，例如视频未跳过，完整的播放了
            }

            @Override
            public void onVideoError() {
                // 广告展示时出错
//                showToast("广告展示失败");
            }

            @Override
            public void onRewardVerify(boolean b, int i, String s, int i1, String s1) {
                // 已废弃 请使用onRewardArrived替代
            }

            @Override
            public void onRewardArrived(boolean b, int i, Bundle bundle) {
                // 奖励发放  b:此次奖励是否有效;i:奖励类型；bunLo：奖励的额外参数
                if (b) {
                    canSave = true;
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            String newPath = FileUtils.getRootFile() + videoAdapter.getItem(selectPosi).getFlieName().replace("0x", "").replace("1x", "");
                            if (FileUtils.getMoveFile(getContext(), videoAdapter.getItem(selectPosi).getPath(), newPath, true)) {
//                                    refreshAlbum(newPath);
                                getActivity().runOnUiThread(() -> {
                                    showToast("文件已导出到" + newPath);
                                });
                                MediaScannerConnection mMediaScanner = new MediaScannerConnection(getContext(), null);
                                mMediaScanner.connect();
                                if (mMediaScanner != null && mMediaScanner.isConnected()) {
                                    mMediaScanner.scanFile(newPath, ".mp4");
                                }
                            } else {
                                getActivity().runOnUiThread(() -> {
                                    showToast("文件导出失败");
                                });
                            }
                        }
                    }).start();
                }
            }

            @Override
            public void onSkippedVideo() {
                // 用户在观看时点击了跳过,没有提示跳过就没有奖励就自己显示一个
            }
        });

        ttRewardVideoAd.setDownloadListener(new TTAppDownloadListener() {
            @Override
            public void onIdle() {
                // 下载空闲
                mHasShowDownloadActive = false;
            }

            @Override
            public void onDownloadActive(long l, long l1, String s, String s1) {
                // 开始下载
                if (!mHasShowDownloadActive) {
                    mHasShowDownloadActive = true;
                    showToast("下载中，点击下载区域暂停");
                }
            }

            @Override
            public void onDownloadPaused(long l, long l1, String s, String s1) {
                // 下载暂停
                showToast("下载暂停，点击下载区域继续");
            }

            @Override
            public void onDownloadFailed(long l, long l1, String s, String s1) {
                // 下载失败
                showToast("下载失败，点击下载区域重新下载");
            }

            @Override
            public void onDownloadFinished(long l, String s, String s1) {
                // 下载结束
                showToast("下载完成，点击下载区域重新下载");
            }

            @Override
            public void onInstalled(String s, String s1) {
                // 应用已安装
                showToast("安装完成，点击下载区域打开");
            }
        });
    }

    //影藏删除按钮
    private void changeDeletet() {
        if (videoAdapter.getData().size() == 0) {
            videolistRv.setVisibility(View.GONE);
            videolistEmpty.setVisibility(View.VISIBLE);
        }
        changeModel(0);
        FileFragment fileFragment = (FileFragment) getParentFragment();
        fileFragment.setModel(0);
    }

    @Override
    public boolean useEventBus() {
        return true;
    }

    /**
     * 接收到推送的事件
     *
     * @param event 事件
     */
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onPushReceiveEvent(final EventMessage event) {
        //录屏成功
        if (event.getCode() == Contents.EventType.TAG_RECORD_SUCCESS) {
            boolean isRecordSuecss = (boolean) event.getData();
            if (isRecordSuecss) {
                getVideoList();
            }
        }
    }

    //检索录屏视频
    private void getVideoList() {
        videolistSrl.setRefreshing(false);
        videoList = FileUtils.getAllScreenRecordFile();
        if (videoList.size() != 0) {
            videoAdapter.setList(videoList);
            videolistRv.setVisibility(View.VISIBLE);
            videolistEmpty.setVisibility(View.GONE);
        } else {
            videolistRv.setVisibility(View.GONE);
            videolistEmpty.setVisibility(View.VISIBLE);
        }
    }

    //拼接视频进度
    BasePopupView basePopupView = null;

    private CommonCallBack callback(final String msg, final String targetPath) {
        ProgressPop progressPop = new ProgressPop(getActivity(), "正在拼接，请稍后...");
        return new CommonCallBack() {
            @Override
            public void onStart() {
                Log.d("CmdProgress", "onStart");
                basePopupView = new XPopup.Builder(getActivity())
                        .dismissOnBackPressed(false)
                        .dismissOnTouchOutside(false)
                        .asCustom(progressPop)
                        .show();
            }

            @Override
            public void onComplete() {
                Log.d("CmdProgress", "onComplete" + targetPath);
                basePopupView.dismiss();
                //重置
                changeModel(0);
                getVideoList();
                fileFragment.setModel(0);
                new XPopup.Builder(getContext()).asConfirm("提示", getResources().getString(R.string.tips_video_save),
                                new OnConfirmListener() {
                                    @Override
                                    public void onConfirm() {
                                        Intent intent = new Intent(getContext(), PlayActivity.class);
                                        intent.putExtra("videoPath", targetPath);
                                        getContext().startActivity(intent);
                                    }
                                })
                        .setCancelText("确定")
                        .setConfirmText("前往查看")
                        .show();
            }

            @Override
            public void onCancel() {
                Log.d("CmdProgress", "Cancel");
                basePopupView.dismiss();
                Toast.makeText(getActivity(), "视频拼接取消", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onProgress(int progress) {
                progressPop.setProgress(progress);
                Log.d("CmdProgress", progress + "");
            }
        };
    }

    //修改模式 0默认 1编辑 2拼接 3开始拼接
    public void changeModel(int type) {
        modelType = type;
        switch (type) {
            //无
            case 0:
                isChooseAll = false;
                if (videoAdapter != null) videoAdapter.setChooseItem(-1, isChooseAll);
                if (videolistChoosell != null) videolistChoosell.setVisibility(View.GONE);
                if (videoAdapter != null) videoAdapter.setShowChoose(false);
                break;
            //1编辑
            case 1:
                if (videolistChoosell != null) videolistChoosell.setVisibility(View.VISIBLE);
                if (videoAdapter != null) videoAdapter.setShowChoose(true);
                break;
            //2拼接
            case 2:
                if (videolistChoosell != null) videolistChoosell.setVisibility(View.GONE);
                if (videoAdapter != null) videoAdapter.setShowChoose(true);
                break;
            case 3:
                if (videoAdapter != null) {
                    ArrayList videoList = new ArrayList<>();
                    for (int i = 0; i < videoAdapter.getData().size(); i++) {
                        ScreenRecordBean screenRecordBean = videoAdapter.getData().get(i);
                        if (screenRecordBean.isChoose()) {
                            videoList.add(screenRecordBean.getPath());
                        }
                        if (i == videoAdapter.getData().size() - 1) {
                            if (videoList.size() < 2) {
                                showToast("最少需要选择两个视频，请选择后再试");
                                return;
                            }
                            String targetPath = FileUtils.getRecordFileName(videoList);
//                            String targetPath = FileUtils.getScreenRecordFile() + System.currentTimeMillis() + ".mp4";
                            String path = FileUtils.createInputFile(getActivity(), (String[]) videoList.toArray(new String[]{}));
                            if (TextUtils.isEmpty(path)) {
                                showToast("最少需要选择两个视频，请选择后再试");
                                return;
                            }
                            FFmpegCommand.runAsync(FFmpegUtils.concatVideo(path, targetPath), callback("视频拼接完成", targetPath));
                        }
                    }
                }
                break;
        }
    }

    // Fragment页面onResume函数重载
    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart("VideoListFragment"); //统计页面("MainScreen"为页面名称，可自定义)
    }

    // Fragment页面onResume函数重载
    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd("VideoListFragment");
    }
}
